Data carousel receiving and caching

ABSTRACT

Data objects are sent using a data carousel and forward error correction. This involves segregating a file into groups, wherein each group represents k data blocks. From the k data blocks of each group, n erasure-encoded blocks are calculated, where n&gt;k. The n erasure-encoded blocks are sent in a round-robin fashion using IP multicast technology: the first erasure-encoded block for each group, then the second block of each group, and so on. At a receiver, the blocks are stored on disk as they are received. However, they are segregated by group as they are stored. When reception is complete, each group is read into RAM, decoded, and written back to disk. In another embodiment, the receiver segregates allocated disk space into areas corresponding to sets of groups. Received blocks are then segregated only by set as they are written to disk. One or more RAM buffers can be used in this embodiment. When reception is complete, each set is read into RAM, decoded, and then written back to disk.

TECHNICAL FIELD

[0001] This invention relates to distribution of data files and otherdata objects using IP multicast techniques in conjunction with forwarderror correction and data carousel techniques. In particular, theinvention relates to methods of receiving, buffering, and decoding dataobjects distributed in this manner.

BACKGROUND OF THE INVENTION

[0002] The existence and popularity of the Internet has created a newmedium for software distribution. As this distribution method becomesmore widely used, it will place more and more demands on Internetbandwidth. Thus, it will be iiimportant to distribute files and otherdata objects as efficiently as possible.

[0003] Currently, data objects are distributed to individual networkclients upon request. When a data object is requested, it is packaged ina plurality of IP (Internet Protocol) packets and transmitted to therequesting client. If another client requests the same data object, theIP packets are re-transmitted to that client. Thus, each request resultsin a full re-transmission of the entire data object over the network.

[0004] This type of data distribution is very inefficient. Theinefficiencies become serious in certain situations where there is arush to obtain a particular data object that has only recently becomeavailable. This situation has been dubbed the Midnight Madness problembecause the mad dash for files often takes place late at night or in theearly morning when files are first made available. Spikes in Internetactivity have been caused by a range of phenomena: popular productreleases; important software updates; security bug fixes; the NASAPathfinder vehicle landing on Mars; the Kasparov vs. Deep Blue chessmatch; and the Starr report. The danger of such traffic spikes lies notin the data type, but rather in the data distribution mechanism.

[0005] The Midnight Madness problem is caused by the Internet's currentunicast “pull” model. A TCP (Transmission Control Protocol) connectionis established between a single sender and each receiver, then thesender transmits a full copy of the data once over each connection. Thesender must send each packet many times, and each copy must traversemany of the same network links. Naturally, the sender and links closestto the sender can become heavily saturated. Nonetheless, such atransmission can create bottlenecks anywhere in the network whereover-subscription occurs. Furthermore, congestion may be compounded by11 long data transfers, either because of large files or slow links.

[0006] These problems can be alleviated through the use of IP multicastprotocols. IP multicast is a method of distributing data in which thedata is sent once from a data server and routed simultaneously to allrequesting clients. Using this method, the sender sends each packet onlyonce, and the data traverses each network link only once. Multicast hasbeen commonly used for so-called “streaming” data such as datarepresenting audio or video. Typically, multicast is used to transmitlive events such as news conferences or audio from broadcast radiostations.

[0007]FIG. 1 shows a network system utilizing IP multicasting. Thesystem includes a data server 10 and a plurality of clients 12 and 13.The system also includes a plurality of routers 14 that route data alongdifferent communications links to the receiving clients. In this case,only the five clients referenced by numeral 12 have requested the datastream, while the clients referenced by numeral 13 have not requestedthe data stream. The data stream is forwarded to the requesting clients12, as indicated by the shaded arrows. However, the data stream is notforwarded to non-requesting clients 13, thus preserving bandwidth on thelinks to those clients.

[0008] IP miulticast provides a powerful and efficient means to transmitdata to multiple parties. However, IP multicast is problematic fortransfers of data objects which must be transmitted reliably, such asfiles. IP multicast provides a datagram service “best-effort” packetdelivery. It does not guarantee that packets sent will be received, nordoes it ensure that packets will arrive in the order they were sent.

[0009] Many reliable file transfer protocols have been built on top ofmulticast. However, since scalability was not a primary concern for mostof these protocols, they are not useful for the midnight madnessproblem. The primary barrier to 1 scalability is that most of theseprotocols require feedback from the receivers in the form ofacknowledgements (ACKs) or negative acknowledgements (NACKs). If manyreceivers generate feedback, they may overload the source orintermediate data links with these acknowledgements.

[0010] A so-called data carousel protocol can be used to providescalable file distribution using multicast protocols. A data carousel isa simple protocol that avoids feedback from receivers. Using thisprotocol, a data server repeatedly sends the same data file using IPmulticast. If a receiver does not correctly receive part of the file,the receiver simply waits for that portion of the file to be transmittedagain.

[0011] Although a data carousel is workable, it often imposes asignificant delay as the receiver waits for the next iteration of thefile transmission. Forward Error Correction (FEC) can be utilized inconjunction with a data carousel to reduce the re-transmission waittime. Using FEC, error correction packets are included in the datastream. The error correction packets allow reconstruction of lostpackets without requiring a wait for the next file transmission.

[0012] Using IP multicast, corrupted packets are automatically detected(using checksums) and discarded by the IP protocol. Accordingly, it isonly necessary to replace lost packets. Therefore, the FEC protocoldescribed herein deals only with erasure correction rather than witherror correction, even though the broader terms “error correction” and“FEC” are used throughout the description.

[0013] Using forward error correction, a data object is broken into datablocks for transmission in respective IP packets. Assuming that thereare k source blocks, these source blocks are encoded into nerasure-encoded blocks of the same size, wherein n>k, in a way thatallows the original k source blocks to be reconstructed from any k ofthe erasure-encoded blocks. This is referred to as (n,k) encoding. Many(n,k) encoding techniques are based on Reed-Solomon codes and areefficient enough to be used by personal computers. See Rizzo, L., andVicisano, L., “Effective Erasure Codes for Reliable ComputerCommunication Protocols”, ACM SIGCOMM Computer Communication Review,Vol. 27, No. 2, pp. 24-36, April 1997, and Rizzo, L., and Vicisano, L.,“Reliable Multicast Data Distribution Protocol-Based on Software FECTechniques”, Proceedings of the Fourth IEEES Workshop on theArchitecture and Implementation of High Performance CommunicationSystems, HPCS'97, Chalkidiki, Greece, June 1997, for examples of an(n,k) encoding method. So-called Tornado codes are viable alternativesto Reed-Solomon codes.

[0014] It is desirable in many situations to utilize systematic (n,k)encoding, in which the first k of the n encoded blocks are the originaldata blocks themselves. If no blocks are lost during transmission, areceiver does not incur any processing overhead when decoding the kblocks of a systematic code. The methods described herein work with, butdo not require, systematic encoding.

[0015]FIG. 2 shows how this scheme works. A data file in this examplecontains k blocks, indicated by reference numeral 20. These k blocks areencoded in a step 21 using a Reed-Solomon encoding algorithm, resultingin n erasure-encoded blocks 22, which are sent repeatedly in a step 23using IP multicast. Each of the n erasure-encoded blocks is the samesize as one of the original k blocks. The receiver waits until it hasreceived any k of the erasure-encoded blocks (indicated by referencenumeral 24), and then decodes them in a step 25 to recreate the originalk source blocks 26.

[0016] In practice, k and n are limited when using Reed-Solomon-basedcodes, because encoding and decoding with large values becomesprohibitively complex. Typical limits are k=64 and n=255.

[0017] Because most files are larger than k blocks (assuming k has beenlimited to some pre-defined maximum), such files are broken into erasurecorrection (EC) groups, each group representing k blocks of the originaldata file. Erasure correction is performed independently for each group.Thus, the k blocks of each group are encoded into n erasure-encodedblocks. Each erasure-encoded block is identified by an index relative toits group, specifying which of the n encoded blocks it is, as well as agroup identifier associating it with a particular EC group. The indexand group identifiers are packaged with the block in a header thatprepends the data itself. The data and header are packaged in an IPpacket and transmitted using the multicast and data carousel techniquesalready described.

[0018] When using EC groups in this manner, the order of blocktransmission affects the time required to reconstruct a data object.Suppose, for example, that all n erasure-encoded blocks are sent fromone group before sending any from the next group. Receivers with fewlosses are forced to receive more blocks than they actually need. Toavoid this, the data server sends the first block (having index=1) fromevery group, then the next block (having index=2) from every group, andso on.

[0019] This is illustrated in FIG. 3, in which each group 30 is shown asa row of erasure-encoded blocks 32. The arrows show the order of blocktransmission, from left to right. Upon transmission of block n of thelast group, transmission begins again with the first block of the firstgroup.

[0020] To complete the reception, a receiver must receive k distincterasure-encoded blocks (i.e. with different index values) from eachgroup. For some groups, more than k blocks may be received, in whichcase the redundant blocks are discarded. These redundant blocks are asource of inefficiency, as they increase the overall reception time.Supposing that only one additional block is needed to complete thereception, it is possible that a receiver may have to wait an entirecycle of G blocks (receiving blocks from all other groups) beforeobtaining another block from the desired group. Thus, the inefficiencyis related to the number of groups G, which is equal to the number ofblocks in the file divided by k.

[0021] One danger with this transmission order is that a pattern ofperiodic network losses may become synchronized with the transmission soas to always impact blocks from certain groups; in the worst case, asingle group is always impacted. One solution to this potential problemis to randomly permute the order of groups sent for each index value,thereby spreading periodic losses randomly among groups.

[0022] During the reception process, a client buffers incoming blocks asthey are received. If enough RAM is available, the blocks are received,sorted, and decoded in main memory before being written to disk. Forlarger files, a client simply writes all blocks to disk in the orderthey are received, discarding any blocks over k that are received for aparticular group. When reception is complete (i.e., k blocks have beenreceived for each group), the blocks are sorted into groups and thendecoded. This method of writing to disk imposes a delay as the file issorted and decoded. This delay can be minimized to some extent bypartial sorting of the blocks before writing them to disk. However, diskI/O can quickly become a bottleneck under this approach. Because thereis no mechanism to slow down the sender, allowing the transmission rateto outpace disk writes results in wasted network bandwidth. With nextgeneration networks running at 100 Mbps, and disks running much slower,this can be a serious problem. Furthermore, random disk writes can beten times slower than sequential disk writes.

[0023] The prior art methods described above provide workable solutionsto the challenging of distributing popular data objects to a pluralityof network clients, while making efficient use of available bandwidth.However, the prior art does not describe an actual embodiment of asystem in which these methods are used. In developing such anembodiment, the inventors have developed certain improvements whichincrease the efficiency and usefulness of the multicast filedistribution using data carousel and erasure correction techniques.

SUMMARY

[0024] The invention embodiments described below include new methods ofreceiving, buffering, and decoding erasure-encoded blocks such as thosedescribed above that are received from a data carousel. In oneembodiment, received blocks are written directly to disk as they arereceived. However, they are segregated by group as they are stored.After receiving the entire data object is complete, each group is readinto RAM, sorted, decoded, and then written back to disk.

[0025] In another embodiment, erasure-encoded blocks are segregated intosets of contiguous groups as the blocks are written to disk. Afterreception is complete, each set is read into RAM, sorted, decoded, andwritten back to disk. In this embodiment, a buffer can be used to bufferincoming erasure-encoded blocks. Received blocks are buffered as long asthey are from the same set of groups. When a new block is received froma different set of groups, the buffer is flushed 11 to disk prior tobuffering the new block. The blocks are segregated by set as they arewritten to disk. However, no other sorting takes place at this time.Alternatively, two buffers can be used so that the new block can bewritten to the second buffer while the first buffer is flushed to disk.

[0026] In another embodiment, a receiver maintains a buffer for everyset of groups. Incoming blocks are buffered in the appropriate buffer,and each buffer is flushed to disk when the buffer becomes full.

[0027] In yet another embodiment, the receiver maintains a single bufferand repeatedly flushes certain blocks of the buffer corresponding tosets of groups. Prior to each write to disk, the system selects a set ofgroups whose blocks will be flushed from the primary memory buffer. Ifany set has at least b blocks in the buffer, that set is selected.Otherwise, any other set is selected. The value b is chosen so that thesize of the memory buffer is bc+b−c+1, where c is the number of groupsin each set of groups.

BRIEF DESCRIPTION OF THE DRAWINGS

[0028]FIG. 1 is a block diagram of a computer network system,illustrating the use of multicast network distribution.

[0029]FIG. 2 is a block diagram showing the use of forward errorcorrection in distributing data objects.

[0030]FIG. 3 is a block diagram showing the use of a data carousel inconjunction with forward error correction.

[0031]FIG. 4 is a block diagram showing a computer network system inaccordance with the invention.

[0032]FIG. 5 is a block diagram of an exemplary computer for use inconjunction with the invention.

[0033]FIG. 6 is a block diagram showing a prior art method of organizingerasure-encoded blocks in groups.

[0034]FIG. 7 is a flowchart showing steps in accordance with theinvention for sending a data file using a data carousel in conjunctionwith forward error correction.

[0035]FIG. 8 is a block diagram showing groups of a data carousel inaccordance with the invention.

[0036]FIGS. 9-12 are block diagrams illustrating a method of receiving,caching, and decoding erasure-encoded blocks in accordance with oneembodiment of the invention.

[0037]FIGS. 13 and 14 are block diagrams illustrating a method ofreceiving, caching, and decoding erasure-encoded blocks in accordancewith another embodiment of the invention.

[0038]FIGS. 15 and 16 are block diagrams illustrating a method ofreceiving, caching, and decoding erasure-encoded blocks in accordancewith yet another embodiment of the invention.

[0039]FIG. 17 is a block diagram illustrating a method of receiving,caching, and decoding erasure-encoded blocks in accordance with yetanother embodiment of the invention.

[0040]FIG. 18 is a block diagram illustrating an IP packet in accordancewith the invention.

DETAILED DESCRIPTION

[0041] Network and Computer Architecture

[0042]FIG. 4 shows a computer network comprising a data server 100 and aplurality of network clients 102. The data server has access to one ormore data objects 104 such as files, program objects, etc. Such objectsare typically located on a hard disk storage medium of the server itselfor on disk storage controlled by another network-accessible computer.The clients 102 are connected to communicate with the data server 100using an IP (Internet Protocol) communications medium 106 such as thepublic Internet or some other wide-area or local-area network.

[0043]FIG. 5 show a general example of a desktop computer 130 that canbe used to implement data server 100 and/or network clients 102.Computer 130 includes one or more processors or processing units 132, asystem memory 134, and a bus 136 that couples various system componentsincluding the system memory 134 to processors 132. The bus 136represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. The system memory 134 includes read onlymemory (ROM) 138 and random access memory (RAM) 140. A basicinput/output system (BIOS) 142, containing the basic routines that helpto transfer information between elements within computer 130, such asduring start-up, is stored in ROM 138.

[0044] Computer 130 further includes a hard disk drive 144 for readingfrom and writing to a hard disk (not shown), a magnetic disk drive 146for reading from and writing to a removable magnetic disk 148, and anoptical disk drive 150 for reading from or writing to a removableoptical disk 152 such as a CD ROM or other optical media. The hard diskdrive 144, magnetic disk drive 146, and optical disk drive 150 areconnected to the bus 136 by an SCSI interface 154 or some otherappropriate interface. The drives and their associated computer-readablemedia provide nonvolatile storage of computer-readable instructions,data structures, program modules and other data for computer 130.Although the exemplary environment described herein employs a hard disk,a removable magnetic disk 148 and a removable optical disk 152, itshould be appreciated by those skilled in the art that other types ofcomputer-readable media which can store data that is accessible by acomputer, such as magnetic cassettes, flash memory cards, digital videodisks, random access memories (RAMs), read only memories (ROMs), and thelike, may also be used in the exemplary operating environment.

[0045] A number of program modules may be stored on the hard disk 144,magnetic disk 148, optical disk 152, ROM 138, or RAM 140, including anoperating system 158 (e.g., the server operating system 20), one or moreapplication programs 160, other program modules 162, and program data164. A user may enter commands and information into computer 130 throughinput devices such as a keyboard 166 and a pointing device 168. Otherinput devices (not shown) may include a microphone, joystick, game pad,satellite dish, scanner, or the like. These and other input devices areconnected to the processing unit 132 through an interface 170 that iscoupled to the bus 136. A monitor 172 or other type of display device isalso connected to the bus 136 via an interface, such as a video adapter174. In addition to the monitor, personal computers typically includeother peripheral output devices (not shown) such as speakers andprinters.

[0046] Computer 130 commonly operates in a networked environment usinglogical connections to one or more remote computers, such as a remotecomputer 176. The remote computer 176 may be another personal computer,a server, a router, a network PC, a peer device or other common networknode, and typically includes many or all of the elements described aboverelative to computer 130, although only a memory storage device 178 hasbeen illustrated in FIG. 5. The logical connections depicted in FIG. 5include a local area network (LAN) 180 and a wide area network (WAN)182. Such networking environments are commonplace in offices,enterprise-wide computer networks, intranets, and the Internet.

[0047] When used in a LAN networking environment, computer 130 isconnected to the local network 180 through a network interface oradapter 184. When used in a WAN networking environment, computer 130typically includes a modem 186 or other means for establishingcommunications over the wide area network 182, such as the Internet. Themodem 186, which may be internal or external, is connected to the bus136 via a serial port interface 156. In a networked environment, programmodules depicted relative to the personal computer 130, or portionsthereof, may be stored in the remote memory storage device. It will beappreciated that the network connections shown are exemplary and othermeans of establishing a communications link between the computers may beused.

[0048] Generally, the data processors of computer 130 are programmed bymeans of instructions stored at different times in the variouscomputer-readable storage media of the computer. Programs and operatingsystems are typically distributed, for example, on floppy disks orCD-ROMs. From there, they are installed or loaded into the secondarymemory of a computer. At execution, they are loaded at least partiallyinto the computer's primary electronic memory. The invention describedherein includes these and other various types of computer-readablestorage media when such media contain instructions or programs forimplementing the steps described below in conjunction with amicroprocessor or other data processor. The invention also includes thecomputer itself when programmed according to the methods and techniquesdescribed below.

[0049] For purposes of illustration, programs and other executableprogram components such as the operating system are illustrated hereinas discrete blocks, although it is recognized that such programs andcomponents reside at various times in different storage components ofthe computer, and are executed by the data processor(s) of the computer.

[0050] Data Object Distribution

[0051] The data server or sender 100 is configured to continuously senddata object 104 to any requesting clients or receivers 102, using amulticast IP data carousel in conjunction with (n,k) erasure correction,generally as described above in the “Background” section of thisdocument. Specifically, the data server transmits the data object to thenetwork clients as a plurality of erasure-encoded blocks in a multicastdata carousel, each erasure-encoded block being packaged in a respectivemulticast IP packet, with a self-describing header. Even morespecifically, the data server breaks the data object into G groups ofsource blocks, each group having no more than k source blocks. The valuek is predetermined in order limit the complexity of computations and tokeep such computations within the capabilities of available computerhardware and software.

[0052] From the k source blocks of each group, the data server computesn erasure-encoded blocks in accordance with a known (n,k) encodingmethod such as a Reed-Solomon encoding method. The n erasure-encodedblocks preferably include the original k source blocks. As describedabove, the k erasure-encoded blocks have sizes that are equal to thesizes of the original k source blocks. As also described, the original ksource blocks can be decoded from any k of the erasure-encoded blocks.

[0053] Using this scheme, a single sender (data server 100) initiatesthe transfer of a single file to a multicast address. The sender loopscontinuously either ad infinitum, or until a certain amount of FCEredundancy has been achieved. Receivers (network clients 102) tune in tothe multicast address and cache received packets in a temporary fileuntil the client receive enough blocks to recreate the file. Receiversmay then drop out of the multicast, or they continue to receive blocksin anticipation of the next file to be sent. In either case, the file isthen decoded, and the file name and attributes set.

[0054] When sending, the data server can either read the original fileand compute the erasure-encoded blocks on the fly, or theerasure-encoded blocks can be pre-computed and stored on disk. Thechoice of which method to use involves a tradeoff between disk storageand processor utilization.

[0055] Selecting k

[0056] Assuming that the original data object contains S blocks, thenumber of groups G will be equal to S/k if S is evenly divisible by k,or S/k+1 if S is not evenly divisible by k (assuming the use of integerdivision). This is expressed as G=ceiling(S/k), where the function“ceiling( )” performs a mathematical operation of rounding up to theclosest integer. From this expression, it is clear that increasing kreduces the number of groups G. Reducing G in turn produce moreefficient data transnission. The most efficient choice would be to set kto the number of blocks S in the original file, whereupon G would equalone. As mentioned above, however, a large k tends to complicate bothencoding and decoding operations. In the described embodiment, k islimited to k_(max)=64.

[0057] For purposes of explanation, assume that k_(max)=8, and that adata object has S=9 data blocks. The number of groups in this examplewill be two: G=ceiling(S/k_(max))=2.

[0058]FIG. 6 shows two groups 190 and 191 and their erasure-encodedblocks 192, assuming that k=kmax=8. Note that the second group requiresseven empty placeholder or padding blocks (indicated by Xs within theblocks). In this extreme example, the wasted overhead of these sevenpadding blocks is nearly 50%.

[0059] In accordance with the invention, k is chosen for a particulardata object based on k_(max) and on the actual number of blocks S in theoriginal data object, in a way that reduces the wasted overhead ofpadding blocks.

[0060]FIG. 7 shows a method of transmitting a data object in accordancewith the invention, including steps that select the number of dataobject blocks k to be included in each group of erasure-encoded blocks.A step 200 comprises determining the minimum number of groups G oferasure-encoded blocks that can represent the S data object blocks, sothat each group of erasure-encoded blocks represents no more thank_(max) data object blocks. In the described embodiment, this stepcomprises evaluating the integer expression G=ceiling(S/k_(max)).

[0061] A subsequent step 202 comprises determining the smallest numberof data object blocks kmin that can be represented in each group whilestill requiring no more than G groups of erasure-encoded blocks torepresent the S data object blocks. In the described embodiment, thisstep comprises evaluating the integer expression kmin=ceiling(S/G).

[0062] In accordance with this aspect of the invention, no more thankmin data object blocks are represented within each group oferasure-encoded blocks. For the example discussed above, in which S=9and k. =8, G will be 2 and kmin will be 5 (using the equations above).Assuming that the same value of k is used in every group, each groupwill use a k=kmin=5.

[0063] Step 204 is FIG. 7 comprises calculating the n erasure-encodeddata blocks for each group G.

[0064] Step 206 comprises transmitting the erasure-encoded blocks of thegroups in a data carousel over a network for reception by multiplenetwork receivers.

[0065] The result is illustrated in FIG. 8, in which the first of twogroups 195 has five data object blocks 196 corresponding to the firstk=5 data blocks of the original data object, and the second of the twogroups 197 has the remaining four data object blocks 196 of the originaldata object plus a single placeholder data block 198.

[0066] Steps 200, 202, and 204 allow k to be reduced in situations wheredoing so does not increase the overall number of groups G. Thisincreases the efficiency of carousel transmission. In accordance withone embodiment of the invention, these steps are performed only where Sis greater than k_(max) and less than k_(max) ². If S is less than orequal to k_(max), G will be equal to 1, and k_(min) is set to S.Otherwise, if G is greater than or equal to k_(max)=the value of k_(min)is set to k_(max).

[0067] In one embodiment, k is the same for all groups used to transmita data object. However, it might be desirable to vary k for each group.In the example above, for instance, the single placeholder blocks can beeliminated entirely by using k=5 in the first group and k=4 in thesecond group. In each case, k is kept at or below the calculatedk_(min). Thus, one embodiment of the invention might vary k betweengroups. In the described embodiment, a header associated with each datablock indicates the particular value of k used in the group with whichthe data block is associated.

[0068] Receiving and Decoding

[0069] In implementing the encoding and transmission scheme describedabove, it has been found that disk performance can become a bottleneckwhen receiving and decoding a data object. If received packets cannot bewritten to disk as quickly as they are received, they must bediscarded—there is no way to instruct the server to slow the datatransmission.

[0070] The task of efficiently writing received packets to disk iscomplicated by the round-robin transmission scheme described above, inwhich erasure-encoded blocks are sent out-of-order. Furthermore, in anIP network, packets may arrive in an order that is different from thetransmission order. Additionally, certain blocks might not be receivedat all, and redundant blocks are to be ignored.

[0071] Generally, a receiver in accordance with the invention isdesigned to reconstruct a data object regardless of the sender's blocktransmission order and regardless of whether certain blocks are missingfrom the received data stream. The receiver does this by accumulatingerasure-encoded blocks for respective groups. When k blocks have beenreceived for a particular group, any further received blocks for thatgroup are ignored and discarded. In addition, any new copy of a blockthat has previously been received is ignored and discarded. Each blockis accompanied by a header structure that indicates the group to whichthe block belongs and the block position (index) within that group.

[0072]FIGS. 9-12 show how erasure-encoded blocks are received, stored,and decoded in one embodiment of the invention. In the followingfigures, erasure-encoded blocks are shown as hatched rectangles. Decodeddata blocks are shown as solid-shaded rectangles. Empty rectanglesindicate reserved disk or memory space.

[0073] Referring to FIG. 9, a transmission stream includes a number ofgroups 302, each of which includes n erasure-encoded blocks 304. Theerasure-encoded blocks within a single group represent contiguous datablocks of the original data object-any k of the erasure-encoded blockscan be used to reconstruct k data blocks of the original file.Erasure-encoded blocks of respective groups are transmittednon-contiguously. Specifically, the blocks are transmitted in around-robin fashion: a block from the first group, then a block from thenext group, and so on.

[0074] As an initialization step, the receiver allocates secondarystorage for a data object or file that is to be received using the FECdata carousel described above. This disk space is shown at the bottom ofFIG. 9. In this step, the receiver allocates a space on its hard diskthat will eventually contain the received and decoded file. The receiverfurther determines group locations 306 within the allocated disk space.Each group location corresponds to a respective one of groups 302 of thetransmitted data stream, and will eventually hold the decoded datablocks represented by the corresponding group.

[0075] Each vertical arrow in FIG. 9 represents the transmission andreception of a single erasure-encoded data block. Transmission andreception proceed in a round-robin fashion, with one block from Group A,then a block from Group B, and so on. FIG. 9 shows the transmission andreception of three erasure-encoded blocks, from Group A, Group B, andGroup C consecutively. In this example, reception begins with the firstgroup, but with the third block within that group.

[0076] Note that FIGS. 9 and 10 show a situation in which blocks arereceived in an orderly fashion from one group to the next and from oneposition to the next within each group. In a more practical example,data losses might disrupt this regular order. In addition, randomizinggroup order in each round of transmission would further disrupt theregular order shown. Regardless, the receiver simply stores eachreceived block in its corresponding group location until k blocks havebeen received for each group, and disregards any blocks belonging togroups for which k blocks have already been received.

[0077] As the erasure-encoded blocks are received, they are segregatedby group on disk. More specifically, the blocks of any particular groupare stored as they are received at the location on disk that has beenallocated for that particular group. Within each group, the blocks arestored in the order received-no attempt is made to sort or decode theerasure-encoded blocks within each group.

[0078]FIG. 10 shows four more erasure-encoded blocks being transmitted,received, and written to disk. The indicated blocks are transmitted inthe order shown, from left to right. As each new block is received, itis written to its corresponding group location on disk, without sorting.

[0079] Reception is complete when k blocks have been received for eachgroup. This is illustrated in FIG. 11, in which each of the grouplocations 306 in secondary storage has been filled. After storing kblocks for each group, each group is sorted and decoded individually.Specifically, each group is read into a RAM buffer 312 or other primarymemory buffer from secondary storage. This is indicated by the curvedarrow of FIG. 11. The erasure-encoded blocks of the group are thensorted and decoded to produce the original k source data blocksrepresented by the group. The decoding is performed in accordance withthe particular (n,k) encoding method employed by the sender.

[0080]FIG. 12 shows that the blocks of Group A have been decoded inprimary memory buffer 312. After decoding, these blocks are written backto their group location 306 on secondary storage, replacing the receivedk erasure-encoded blocks. The process eventually reconstructs theoriginal file as the blocks of group are decoded.

[0081]FIGS. 13-14 shows how blocks are received and stored in anotherembodiment of the invention. In this embodiment, groups 330 areorganized in sets of groups 332, wherein each set 332 includes aplurality of contiguous groups 330. Referring to FIG. 13, a first set inthis example is formed by Groups A, B, and C. Group D and two followinggroups (not shown) form a second set.

[0082] This organization does not take place at the sender, which sendsthe individual erasure-encoded blocks in the same order as describedabove. However, the receiver defines its disk areas in terms of thesesets of groups, rather than in terms of individual groups. Thus, thereceiver allocates secondary storage for each set of groups andseparately identifies an area 333 for each set of groups. When a blockis received from a particular set, the block is written to the locationof that set on disk-no attempt is made at this point to sort theerasure-encoded blocks or to segregate the blocks by group within eachset.

[0083] In this embodiment, the receiver maintains one or more primarymemory buffers 334 for buffering incoming erasure-encoded blocks. Asingle buffer is large enough to store a plurality of erasure-encodedblocks, although perhaps not large enough to store an entire set ofblocks. The receiver buffers contiguously-received erasure-encodedblocks in a single primary memory buffer 334 as long as thecontiguously-received blocks are from a common set of groups. This isshown in FIG. 13, where erasure-encoded blocks from the first set arebeing written to a first of two available buffers 334. As long as thereceived blocks are from the same set of groups and the buffer is notfull, the blocks are written to buffer 334. Each block is written to thenext available position in the buffer. Blocks are disregarded if theyare from a group for which k blocks have already been received.

[0084] Upon receiving a new erasure-encoded block from a set of groupsother than the previous, common set of groups, or upon filling thebuffer, the receiver flushes the buffer by writing the buffered blocksto the set area 333 that has already been allocated for the set ofgroups contained in the buffer. This is shown in FIG. 14, where thebuffered blocks are written to their corresponding disk area 333. Thebuffered blocks are copied to the next available locations in thecorresponding disk area without sorting or segregating by block. Thus,the blocks are buffered and stored on disk within each set in the orderof their reception.

[0085] As the blocks from the first buffer are being copied to disk, thenewly-received block, from a different set, is buffered in the second ofthe two buffers 334. Use of the buffers alternates in this fashion untilk blocks have been received for each group of each set.

[0086] Once reception is complete (k blocks have been received for eachgroup), the blocks are decoded in a process similar to that shown inFIG. 12, except that sets of groups (rather than individual groups) areread into primary memory, sorted, decoded, and then written back todisk.

[0087] Assuming that there are b groups in each set, each buffer isallocated with a size of b blocks. When blocks are received in anorderly fashion from one group to the next, b blocks belonging to asingle set of groups will be received together, and a disk write will inmost cases be performed only after receiving b blocks. Two buffers workwell in this situation—one is used to receive data while the contents ofthe other is written to disk. However, randomizing the group order ineach round of transmission as discussed above will either greatlyincrease the frequency at which buffers are flushed or will require manymore buffers to simultaneously receive blocks from many different sets.

[0088] Rather than randomizing group order in this situation, it ispreferable to randomly select a starting group for each round, and thencomplete the round in order. Within each round, a starting group israndomly selected and an erasure-encoded block is transmitted from thisgroup. Transmission then proceeds in group order, with anerasure-encoded block being transmitted from each of the remaininggroups. “Group order” is defined to wrap from the last group back to thefirst group.

[0089] When transmitting in this manner, three primary memory bufferswork well. Typically, transmission starts with a block from a group thatis in the middle of a set. This block and any following blocks from thesame set are buffered in a first buffer. When transmission reaches ablock from another set, second and third buffers are used alternately tobuffer blocks from remaining sets. Finally, the transmission order wrapsback to the beginning groups of the initial set, remaining blocks (forthe current round) of that set are received in the first buffer, and thefirst buffer is then flushed as a new round begins into one of the otherbuffers.

[0090] The benefit of this method is fewer, larger writes in place ofmany small writes, which allows writing to be performed much faster.

[0091]FIGS. 15 and 16 show a variation of the embodiment of FIGS. 13 and14. In this embodiment, the receiver maintains a buffer 340 for eachdefined set of the incoming data object. A received erasure-encodedblock is buffered in the primary memory buffer corresponding to the setcontaining the block. Individual buffers are flushed when they becomefull, by writing their contents to the corresponding set area 342 ondisk. Decoding proceeds as in the embodiment of FIGS. 13 and 14. Thismethod does not assume any particular group order, and thereby allowsrandomization of group order within each round.

[0092]FIG. 17 shows yet another scheme for buffering incoming blocks.This scheme is similar to the one described above, in that which theincoming blocks are arranged on disk in sets 340 of groups. However,only a single primary memory buffer 342 is used instead of the multiplebuffers 334 indicated in FIG. 16. As blocks are received, they arewritten to the buffer 342 in any available location. Counts aremaintained to indicate the number of currently buffered blocks for eachset of groups. Set areas 344 are reserved in secondary storage foreventual storage of blocks belonging to those sets.

[0093] In this scheme, disk writes happen repeatedly whenever the systemhas time to initiate such writes. Each write involves blocks of a singleset that have been buffered in memory 342. Prior to a disk write, thesystem selects a set whose blocks will be written from the primarymemory buffer to disk. If any set has b or more buffered blocks in theprimary memory buffer, that set is chosen to have its blocks flushed todisk. Otherwise, any set can be chosen to have its blocks flushed todisk. FIG. 17 illustrates a write operation to a first set area. Noattempt is made to sort or decode the blocks of a particular set as theyare written to disk. Rather, each block is written to the next availablelocation in the disk space reserved for the set.

[0094] The value b (the number of groups in a set) is predefined andrelates to the size of the primary memory buffer. Specifically, b ischosen so that the size of the primary memory buffer is equal tobc+b−c+1 blocks, where c is the number of groups in each set. Thisrelationship between has been found to prevent buffer overflow whenusing this scheme.

[0095] The actual disk write can take place in one of two differentways. Some systems allow so-called “gather writing,” in which a singlecontiguous disk write can utilize data from a number of discontiguousmemory blocks. In system such as this, the disk write is specified toutilize the buffer locations having the b buffered blocks. In systemsthat do not support gather writing, the b blocks are copied to anintermediate memory buffer and then written to disk in a single diskwrite.

[0096] After k blocks have been received and written to disk for eachgroup, each set it read into primary memory, sorted, decoded, andwritten back to disk.

[0097] Session and Meta-File Information

[0098] Senders and receivers need to agree on certain session attributesto communicate. Session descriptions might include a multicast addressand port number, which might be carried in a session announcement,publicized on a Web page with scheduling information, or conveyed viaemail or other out-of-band methods.

[0099] When files are the objects being transferred, the receiver needscertain metadata in addition to actual file data. Metadata consists ofinformation which is needed or useful for creating a disk file, butwhich is not part of the file itself, for example, the file name, itscreation-date, time last modified, file attributes, etc. In many cases,this information is part of a file directory or similar diskorganization structure rather than part of the file itself.

[0100] In the embodiment described here, metadata is appended to the endof the file as a “trailer” and sent as part of the data carousel. Oncethe erasure-encoded blocks are decoded, the metadata is extracted andused in creating the actual file structure.

[0101] The length of the metadata might vary between files. In thedescribed embodiment, a predefined number of bytes at the end of thefile are reserved for a value that indicates the length of the metadata.

[0102] Appending the metadata in this manner allows the original file tobe reconstructed by simply truncating the file, rather than rewritingit. A checksum is included in the trailer to validate that the file wasencoded and decoded correctly.

[0103] Packet Headers

[0104]FIG. 18 shows the general makeup of an IP multicast packet in thedescribed embodiments of the invention. The IP packet itself comprisesan IP header 400 and an IP payload 402 in accordance with conventionalIP multicast technology. The IP payload comprises a block header 404 andan erasure-encoded block 406.

[0105] The block header 404 includes the following parameters:

[0106] A sequence number that is unique for each packet of a transmitteddata object. The sequence number increases monotonically with eachpacket sent, allowing the receiver to track packet loss.

[0107] A file identifier—an identifier assigned by the sender.

[0108] A file length specification indicating the length, in bytes, ofthe original data file. The file length is included so that the receivercan allocate memory structures for receiving the file once it hasreceived the first erasure-encoded block.

[0109] A group identifier, indicating the group to which theerasure-encoded block belongs.

[0110] The value of k used in encoding and decoding the blocks. Thisvalue, in conjunction with the file length, allows the receiver tocalculate the number of groups G.

[0111] An index value, indicating the position of the erasure-encodedblock within its group. Packets with indices 0 through k−1 are originalfile blocks, while packets with indices k to n−1 are encoded blocks.

[0112] By including the file length and k in every packet, a receivercan begin receiving without having to obtain additional, out-of-bandinformation. Additionally, including k in each header allows k to bevaried for different groups as discussed above.

[0113] The packet size and the value of n are not specified in the blockheader-they are not needed by the receiver for proper reception.

CONCLUSION

[0114] The embodiments described above provide useful improvements overpreviously described methods of distributing data files and otherobjects using data carousels and forward error correction. Inparticular, the discussion above allows optimization of k and alsoprovides a practical solution to the problem of caching received blocksat a speed sufficient to keep up with a fast multicast transmission,while also minimizing subsequent decoding time after reception has beencompleted.

[0115] Although the invention has been described in language specific tostructural features and/or methodological steps, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or steps described. Rather, thespecific features and steps are disclosed as preferred forms ofimplementing the claimed invention.

1. A method of reconstructing a data object that is transmitted from aremote source using a data carousel of erasure-encoded blocks, theerasure-encoded blocks being encoded in groups, wherein theerasure-encoded blocks of respective groups are transmittednon-contiguously, the method comprising the following steps: receivingthe erasure-encoded blocks; storing erasure-encoded blocks of the groupsin secondary storage as they are received without decoding theerasure-encoded blocks; the storing step including a step of segregatingthe erasure-encoded blocks by group within the secondary storage as theerasure-encoded blocks are stored.
 2. A method as recited in claim 1,further comprising: decoding each group after receiving itserasure-encoded blocks.
 3. A method as recited in claim 1, furthercomprising: after receiving the erasure-encoded blocks for a particulargroup, reading the group into primary memory from secondary storage;decoding the erasure-encoded blocks of the particular group to producedecoded blocks of the data object; replacing the erasure-encoded blocksof the particular group in secondary storage with the decoded blocks ofthe data object.
 4. A method as recited in claim 1, the storing stepfurther including a step of storing the erasure-encoded blocks of eachgroup within the secondary storage in the order in which the blocks ofthe group are received.
 5. A method of reconstructing a data object onsecondary storage, wherein the data object is transmitted from a remotesource using a data carousel of erasure-encoded blocks, theerasure-encoded blocks being encoded in groups that represent contiguousdata blocks of the data object, wherein the erasure-encoded blocks ofrespective groups are transmitted non-contiguously, the methodcomprising the following steps: allocating secondary storage for thedata object and determining locations in the allocated secondary storagefor the respective data blocks represented by the groups oferasure-encoded blocks; receiving the erasure-encoded blocks; storingerasure-encoded blocks of any particular group as they are received atthe determined location in the allocated secondary storage for thecontiguous data blocks represented by the particular group.
 6. A methodas recited in claim 5, further comprising: decoding each group afterstoring its erasure-encoded blocks.
 7. A method as recited in claim 5,further comprising: after receiving and storing the erasure-encodedblocks for a given group, reading the given group into primary memoryfrom secondary storage; decoding the erasure-encoded blocks of the givengroup to produce the data blocks represented by the given group;replacing the erasure-encoded blocks of the given group in secondarystorage with the decoded blocks of the data object.
 8. A method asrecited in claim 5, the storing step further including a step of storingthe erasure-encoded blocks of each group in the order in which theblocks of the group are received.
 9. One or more computer-readablestorage media containing a program for reconstructing a data object onsecondary storage, wherein the data object is transmitted from a remotesource using a data carousel of erasure-encoded blocks, theerasure-encoded blocks being encoded in groups that represent contiguousdata blocks of the data object, wherein the erasure-encoded blocks ofrespective groups are transmitted non-contiguously, the programcomprising the following steps: allocating secondary storage for thedata object and determining locations in the allocated secondary storagefor the respective data blocks represented by the groups oferasure-encoded blocks; receiving the erasure-encoded blocks; storingerasure-encoded blocks of any particular group as they are received atthe determined location in the allocated secondary storage for thecontiguous data blocks represented by the particular group; afterreceiving and storing the erasure-encoded blocks for a given group,reading the given group into primary memory from secondary storage;decoding the erasure-encoded blocks of the given group to produce thedata blocks represented by the given group; replacing theerasure-encoded blocks of the given group in secondary storage with thedata blocks represented by the given group to construct the data objectin the allocated secondary storage.
 10. One or more computer-readablestorage media as recited in claim 9, the storing step further includinga step of storing the erasure-encoded blocks of each group in the orderof their reception.